A compiler is a computer program that transforms source code into object code. The source code is typically written in a programming language and the object code is specific to the underlying hardware of a target information processing system. As such, compilers enable the development of programs that are hardware-independent.
When it is executing, the compiler first syntactically parses the source code statements one after the other. Then, in one or more successive passes, it generates the object code, making sure that statements that reference other statements are referred to correctly. The resulting object code comprises machine code that a target processor can process or execute one instruction at a time.
It is common to assess the performance of such compilers through the use of specialized “benchmark” programs, which provide insight into the various operations performed by a compiler. In turn, these insights are then used by compiler developers to optimize the performance of the compiler. As an example, redundant operations or computations in the source code may be identified that could be restructured, or transformed, to be more efficient, but which give the same output. Once it is determined which generic restructures or transformations improve the operation of the source code, they are then implemented in the compiler. However, performing such operations may cause unintended consequences. As an example, when manipulating C++ code, an innocent looking ‘*’ may not be a simple multiplier, but may be an overloaded operator* ( . . . ) where the operator can have more than one meaning. Consequently, addition and multiplication operations may not follow the associative, commutative and hence, distributive manipulation laws of arithmetic.